<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script src="js/jquery-3.3.1.min.js"></script>
</head>
<body>
<div id="div1">11111111111</div>
<div id="div2">22222222222</div>

<script>
   /* var elementsByTagName = document.getElementsByTagName("div");

    alert(elementsByTagName.length);
    for (var i = 0; i < elementsByTagName.length; i++) {
        //var obj = elementsByTagName[i];
        // elementsByTagName[i].innerHTML="aaaaaaa";
        $(elementsByTagName[i]).html("aaaaaaa");
    }*/


    //jq 通过jq来获取div中所有元素对象
    var $div = $("div");
    alert($div.length);

    //jq--->js
    $div[0].innerHTML="aaaaaaaa";
    $div.get(1).innerHTML="bbbbbbbbbb";

</script>
</body>
</html>